package com.wlr.blog.api;

import com.wlr.blog.util.common.dto.Result;
import com.wlr.blog.web.common.entity.Article;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author lrwang
 * @version 1.0
 * @date 2022/11/12 13:03
 */
@FeignClient(value = "blog-front", path = "/front/article")
public interface ArticleFeignApi {
    /**
     * 保存文章接口
     *
     * @param article 文章信息
     * @return 结果
     */
    @PostMapping("/save")
    Result save(@RequestBody Article article);

    /**
     * 查询文章列表接口
     *
     * @param params 查询条件
     * @return 文章列表
     */
    @GetMapping("/list")
    Result getArticleList(@RequestParam Map<String, Object> params);
}
